First, keep-alive mode1. The HTTP protocol uses "request-answer" mode, when using normal mode, that is, non-keepalive mode , each request/reply client and server to create a new connection, immediately after the completion of the connection (the
1.keep-aliveThe Linux kernel is configured with a tcp_keepalive_time, a keepalive timer for TCP. When two connected processes on the network have no data to send to each other, TCP sends keepalive data at intervals to keep the connection, and the
In Linux, the implementation source code of TCP keep alive is analyzed, and keepaliveKeep Alive under TCP
We often say that the TCP keep alive is to ensure the validity of the connection, send a test packet at a certain interval, and confirm
In normal communication, if the send function is successfully sent, the number of bytes of the sent data is returned. If an error occurs, send returns-1, and the global variable errno is set. In many cases, sending returns-1 because the connection
Original address: http://blog.csdn.net/oceanperfect/article/details/510645741. HTTP keep-aliveIn the early days of HTTP, each HTTP request required an TPC socket connection to open, and the TCP connection was disconnected after use once.Using
NeedsDetects whether the client program is forced to end without affecting server processing.StatusBoth the server side and the client socket set the KeepAlive property.Server-side set the number of probes and other parameters, the client, the
NeedsDetects whether the client program is forced to end without affecting server processing.StatusBoth the server side and the client socket set the KeepAlive property.Server-side set the number of probes and other parameters, the client, the
Keep Alive under TCPWe often say that the TCP keep alive, is to ensure the validity of the connection, at a certain time interval to send a probe packet, based on the reply to confirm that the connection is valid. Typically, upper-level applications
[Requirement]Checks whether the client program is forcibly terminated without affecting server processing.[Status quo]The keepalive attribute is set for both the server and client sockets.The server sets parameters such as the number of probes. The
1. What is keep-alive mode?We know that the HTTP protocol uses "request-answer" mode, when using normal mode, that is, non-keepalive mode, each request/reply client and server to create a new connection, immediately after the completion of the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.